import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'
import { Observable } from 'rxjs'

@Injectable()
export class AdminGuard implements CanActivate {
	canActivate(ctx: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
		const { user } = ctx.switchToHttp().getRequest()
		return user?.id == 1
	}
}
